package com.mujin.keji.collectionsystem.common;

/**
 * 还款能力enum
 */
public enum RepayPowerEnum {
    ability_repay("ability_repay","有还款能力"),
    ability_part_repay("ability_part_repay","有部分还款能力"),
    unable_judge("unable_judge","无法判断"),
    not_ability_repay("not_ability_repay","无还款能力")
    ;

    /** 状态码 **/
    private final String code;
    /** 状态描述 **/
    private final String description;

    RepayPowerEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String find(Integer origin) {
        if(origin == null){
            return null;
        }
        for (RepayPowerEnum frs : RepayPowerEnum.values()) {
            if ((frs.ordinal()+1) == origin) {
                return frs.getCode();
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
